package Vista;
import Controlador.handlerVentAsocProf;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentAsocProfesor extends javax.swing.JFrame {
	private JLabel lblLegajo;
	private JLabel lblNumero;
	private JTextField txtLegajo;
	private JTextField txtNumero;
	private JButton btnSalir;
	private JButton btnAsignar;

	/**
	* Auto-generated main method to display this JFrame
	*/
	
	public VentAsocProfesor() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Asociar Profesor");
			getContentPane().setLayout(null);
			{
				lblLegajo = new JLabel();
				getContentPane().add(lblLegajo);
				lblLegajo.setText("Legajo Profe: ");
				lblLegajo.setBounds(38, 34, 124, 17);
			}
			{
				lblNumero = new JLabel();
				getContentPane().add(lblNumero);
				lblNumero.setText("Numero Curso: ");
				lblNumero.setBounds(38, 75, 124, 17);
			}
			{
				txtLegajo = new JTextField();
				getContentPane().add(txtLegajo);
				txtLegajo.setBounds(197, 31, 120, 21);
			}
			{
				txtNumero = new JTextField();
				getContentPane().add(txtNumero);
				txtNumero.setBounds(192, 76, 125, 21);
			}
			{
				btnAsignar = new JButton();
				getContentPane().add(btnAsignar);
				btnAsignar.setText("Asignar");
				btnAsignar.setBounds(65, 144, 110, 21);
				btnAsignar.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						handlerVentAsocProf h = new handlerVentAsocProf();
						h.asignarMateriaProfe(Integer.parseInt(txtLegajo.getText()), Integer.parseInt(txtNumero.getText()));
					}
				});
			}
			{
				btnSalir = new JButton();
				getContentPane().add(btnSalir);
				btnSalir.setText("Salir");
				btnSalir.setBounds(228, 144, 104, 21);
				btnSalir.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						dispose();
					}
				});
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
